<?php
class mdl_reff_status extends CI_Model{
	
	function __construct(){
		parent::__construct();
	}

	function get_select_reff_status($d=""){
		$name = isset($d['name'])?$d['name']:'';
		$id = isset($d['id'])?$d['id']:'';
		$class = isset($d['class'])?$d['class']:'';
		$value = isset($d['value'])?$d['value']:'';
		
		$this->db->flush_cache();
		$this->db->from('reff_status');
		$this->db->order_by('id');
		
		$res = $this->db->get();
		
		$out = '';
		$out .= '<option value="" selected="selected">-- Pilih --</option>';
		foreach($res->result() as $r){
			if($r->id == trim($value)){
				$out .= '<option value="'.$r->id.'" selected="selected">'.$r->nama.'</option>';
			}else{
				$out .= '<option value="'.$r->id.'">'.$r->nama.'</option>';
			}
		}
		
		
		return $out;
	}


}

?>